home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / PInterfaces / InputSprocket.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  25.0 KB  |  818 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        InputSprocket.p
  3.  
  4.      Contains:    Games Sprockets: InputSprocket interfaaces
  5.  
  6.      Version:    Technology:    Input Sprocket 1.3
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1996-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT InputSprocket;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __INPUTSPROCKET__}
  27. {$SETC __INPUTSPROCKET__ := 1}
  28.  
  29. {$I+}
  30. {$SETC InputSprocketIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __EVENTS__}
  37. {$I Events.p}
  38. {$ENDC}
  39.  
  40.  
  41. {$PUSH}
  42. {$ALIGN POWER}
  43. {$LibExport+}
  44.  
  45. {$IFC UNDEFINED USE_OLD_INPUT_SPROCKET_LABELS }
  46. {$SETC USE_OLD_INPUT_SPROCKET_LABELS := 0 }
  47. {$ENDC}
  48.  
  49. {$IFC UNDEFINED USE_OLD_ISPNEED_STRUCT }
  50. {$SETC USE_OLD_ISPNEED_STRUCT := 0 }
  51. {$ENDC}
  52.  
  53. { ********************* data types ********************* }
  54.  
  55. TYPE
  56.     ISpDeviceReference = ^LONGINT;
  57.     ISpElementReference = ^LONGINT;
  58.     ISpElementListReference = ^LONGINT;
  59. { ISpDeviceClass is a general classs of device, example: keyboard, mouse, joystick }
  60.     ISpDeviceClass                        = OSType;
  61. { ISpDeviceIdentifier is a specific device,  example: standard 1-button mouse, 105key ext. kbd. }
  62.     ISpDeviceIdentifier                    = OSType;
  63.     ISpElementLabel                        = OSType;
  64.     ISpElementKind                        = OSType;
  65.  
  66. { *************** errors -30420 to -30439***************** }
  67.  
  68. CONST
  69.     kISpInternalErr                = -30420;
  70.     kISpSystemListErr            = -30421;
  71.     kISpBufferToSmallErr        = -30422;
  72.     kISpElementInListErr        = -30423;
  73.     kISpElementNotInListErr        = -30424;
  74.     kISpSystemInactiveErr        = -30425;
  75.     kISpDeviceInactiveErr        = -30426;
  76.     kISpSystemActiveErr            = -30427;
  77.     kISpDeviceActiveErr            = -30428;
  78.     kISpListBusyErr                = -30429;
  79.  
  80. { *************** resources **************** }
  81.     kISpApplicationResourceType    = 'isap';
  82.     kISpSetListResourceType        = 'setl';
  83.     kISpSetDataResourceType        = 'setd';
  84.  
  85.  
  86. TYPE
  87.     ISpApplicationResourceStructPtr = ^ISpApplicationResourceStruct;
  88.     ISpApplicationResourceStruct = RECORD
  89.         flags:                    UInt32;
  90.         reserved1:                UInt32;
  91.         reserved2:                UInt32;
  92.         reserved3:                UInt32;
  93.     END;
  94.  
  95.  
  96. CONST
  97.     kISpAppResFlag_UsesInputSprocket = $00000001;                {  true if the application uses InputSprocket }
  98.     kISpAppResFlag_UsesISpInit    = $00000002;                    {  true if the calls ISpInit (ie, uses the high level interface, calls ISpConfigure, has a needs list, etc...) }
  99.  
  100. {
  101.  * ISpDeviceDefinition
  102.  *
  103.  * This structure provides all the available
  104.  * information for an input device within the system
  105.  *
  106.  }
  107.  
  108. TYPE
  109.     ISpDeviceDefinitionPtr = ^ISpDeviceDefinition;
  110.     ISpDeviceDefinition = RECORD
  111.         deviceName:                Str63;                                    {  a human readable name of the device  }
  112.         theDeviceClass:            ISpDeviceClass;                            {  general classs of device example : keyboard, mouse, joystick  }
  113.         theDeviceIdentifier:    ISpDeviceIdentifier;                    {  every distinguishable device should have an OSType  }
  114.         permanentID:            UInt32;                                    {  a cross reboot id unique within that deviceType, 0 if not possible  }
  115.         flags:                    UInt32;                                    {  status flags  }
  116.         reserved1:                UInt32;
  117.         reserved2:                UInt32;
  118.         reserved3:                UInt32;
  119.     END;
  120.  
  121.  
  122. CONST
  123.     kISpDeviceFlag_HandleOwnEmulation = 1;
  124.  
  125. {
  126.  * ISpElementEvent, ISpElementEventPtr
  127.  *
  128.  * This is the structure that event data is passed in.
  129.  *
  130.  }
  131.  
  132. TYPE
  133.     ISpElementEventPtr = ^ISpElementEvent;
  134.     ISpElementEvent = RECORD
  135.         when:                    AbsoluteTime;                            {  this is absolute time on PCI or later, otherwise it is  }
  136.                                                                         {  0 for the hi 32 bits and TickCount for the low 32 bits  }
  137.         element:                ISpElementReference;                    {  a reference to the element that generated this event  }
  138.         refCon:                    UInt32;                                    {  for application usage, 0 on the global list  }
  139.         data:                    UInt32;                                    {  the data for this event  }
  140.     END;
  141.  
  142. {
  143.  * ISpElementInfo, ISpElementInfoPtr
  144.  *
  145.  * This is the generic definition of an element.
  146.  * Every element must contain this information.
  147.  *
  148.  }
  149.     ISpElementInfoPtr = ^ISpElementInfo;
  150.     ISpElementInfo = RECORD
  151.         theLabel:                ISpElementLabel;
  152.         theKind:                ISpElementKind;
  153.         theString:                Str63;
  154.         reserved1:                UInt32;
  155.         reserved2:                UInt32;
  156.     END;
  157.  
  158.     ISpNeedFlagBits                        = UInt32;
  159. {$IFC USE_OLD_ISPNEED_STRUCT }
  160.     ISpNeedPtr = ^ISpNeed;
  161.     ISpNeed = RECORD
  162.         name:                    Str63;
  163.         iconSuiteResourceId:    INTEGER;                                {  resource id of the icon suite  }
  164.         reserved:                INTEGER;
  165.         theKind:                ISpElementKind;
  166.         theLabel:                ISpElementLabel;
  167.         flags:                    ISpNeedFlagBits;
  168.         reserved1:                UInt32;
  169.         reserved2:                UInt32;
  170.         reserved3:                UInt32;
  171.     END;
  172.  
  173. {$ELSEC}
  174.     ISpNeed = RECORD
  175.         name:                    Str63;                                    {  human-readable string  }
  176.         iconSuiteResourceId:    INTEGER;                                {  resource id of the icon suite  }
  177.         playerNum:                SInt8;                                    {  used for multi-player support  }
  178.         group:                    SInt8;                                    {  used to group related needs (eg, look left and look right button needs)  }
  179.         theKind:                ISpElementKind;
  180.         theLabel:                ISpElementLabel;
  181.         flags:                    ISpNeedFlagBits;
  182.         reserved1:                UInt32;
  183.         reserved2:                UInt32;
  184.         reserved3:                UInt32;
  185.     END;
  186.  
  187. {$ENDC}  {USE_OLD_ISPNEED_STRUCT}
  188.  
  189.  
  190. CONST
  191.     kISpNeedFlag_NoMultiConfig    = $00000001;                    {  once this need is autoconfigured to one device dont autoconfigure to anything else }
  192.     kISpNeedFlag_Utility        = $00000002;                    {  this need is a utility function (like show framerate) which would not typically be assigned to anything but the keyboard }
  193.     kISpNeedFlag_PolledOnly        = $00000004;
  194.     kISpNeedFlag_EventsOnly        = $00000008;                    {  *** kISpElementKind specific flags *** }
  195.                                                                 {  these are flags specific to kISpElementKind_Button }
  196.     kISpNeedFlag_Button_AlreadyAxis = $10000000;                {  there is a axis version of this button need }
  197.     kISpNeedFlag_Button_ClickToggles = $20000000;
  198.     kISpNeedFlag_Button_ActiveWhenDown = $40000000;
  199.     kISpNeedFlag_Button_AlreadyDelta = $80000000;                {  there is a delta version of this button need }
  200.                                                                 {  these are flags specific to kISpElementKind_DPad }
  201.                                                                 {  these are flags specific to kISpElementKind_Axis }
  202.     kISpNeedFlag_Axis_AlreadyButton = $10000000;                {  there is a button version of this axis need }
  203.     kISpNeedFlag_Axis_Asymetric    = $20000000;                    {  this axis need is asymetric     }
  204.     kISpNeedFlag_Axis_AlreadyDelta = $40000000;                    {  there is a delta version of this axis need }
  205.                                                                 {  these are flags specific to kISpElementKind_Delta }
  206.     kISpNeedFlag_Delta_AlreadyAxis = $10000000;                    {  there is a axis version of this delta need }
  207.     kISpNeedFlag_Delta_AlreadyButton = $20000000;                {  there is a button version of this delta need }
  208.  
  209. {
  210.  *
  211.  * These are the current built values for ISpDeviceClass
  212.  *
  213.  }
  214.     kISpDeviceClass_SpeechRecognition = 'talk';
  215.     kISpDeviceClass_Mouse        = 'mous';
  216.     kISpDeviceClass_Keyboard    = 'keyd';
  217.     kISpDeviceClass_Joystick    = 'joys';
  218.     kISpDeviceClass_Wheel        = 'whel';
  219.     kISpDeviceClass_Pedals        = 'pedl';
  220.     kISpDeviceClass_Levers        = 'levr';
  221.     kISpDeviceClass_Tickle        = 'tckl';                        {  a device of this class requires ISpTickle }
  222.     kISpDeviceClass_Unknown        = '????';
  223.  
  224. {
  225.  * These are the current built in ISpElementKind's
  226.  * 
  227.  * These are all OSTypes.
  228.  *
  229.  }
  230.     kISpElementKind_Button        = 'butn';
  231.     kISpElementKind_DPad        = 'dpad';
  232.     kISpElementKind_Axis        = 'axis';
  233.     kISpElementKind_Delta        = 'dlta';
  234.     kISpElementKind_Movement    = 'move';
  235.     kISpElementKind_Virtual        = 'virt';
  236.  
  237.  
  238. {
  239.  *
  240.  * These are the current built in ISpElementLabel's
  241.  *
  242.  * These are all OSTypes.
  243.  *
  244.  }
  245. {$IFC USE_OLD_INPUT_SPROCKET_LABELS }
  246.                                                                 {  axis  }
  247.     kISpElementLabel_XAxis        = 'xaxi';
  248.     kISpElementLabel_YAxis        = 'yaxi';
  249.     kISpElementLabel_ZAxis        = 'zaxi';
  250.     kISpElementLabel_Rx            = 'rxax';
  251.     kISpElementLabel_Ry            = 'ryax';
  252.     kISpElementLabel_Rz            = 'rzax';
  253.     kISpElementLabel_Gas        = 'gasp';
  254.     kISpElementLabel_Brake        = 'brak';
  255.     kISpElementLabel_Clutch        = 'cltc';
  256.     kISpElementLabel_Throttle    = 'thrt';
  257.     kISpElementLabel_Trim        = 'trim';                        {  direction pad  }
  258.     kISpElementLabel_POVHat        = 'povh';
  259.     kISpElementLabel_PadMove    = 'move';                        {  buttons  }
  260.     kISpElementLabel_Fire        = 'fire';
  261.     kISpElementLabel_Start        = 'strt';
  262.     kISpElementLabel_Select        = 'optn';
  263.  
  264. {$ENDC}  {USE_OLD_INPUT_SPROCKET_LABELS}
  265.  
  266.                                                                 {  generic  }
  267.     kISpElementLabel_None        = 'none';                        {  axis  }
  268.     kISpElementLabel_Axis_XAxis    = 'xaxi';
  269.     kISpElementLabel_Axis_YAxis    = 'yaxi';
  270.     kISpElementLabel_Axis_ZAxis    = 'zaxi';
  271.     kISpElementLabel_Axis_Rx    = 'rxax';
  272.     kISpElementLabel_Axis_Ry    = 'ryax';
  273.     kISpElementLabel_Axis_Rz    = 'rzax';
  274.     kISpElementLabel_Axis_Roll    = 'rzax';
  275.     kISpElementLabel_Axis_Pitch    = 'rxax';
  276.     kISpElementLabel_Axis_Yaw    = 'ryax';
  277.     kISpElementLabel_Axis_RollTrim = 'rxtm';
  278.     kISpElementLabel_Axis_PitchTrim = 'trim';
  279.     kISpElementLabel_Axis_YawTrim = 'rytm';
  280.     kISpElementLabel_Axis_Gas    = 'gasp';
  281.     kISpElementLabel_Axis_Brake    = 'brak';
  282.     kISpElementLabel_Axis_Clutch = 'cltc';
  283.     kISpElementLabel_Axis_Throttle = 'thrt';
  284.     kISpElementLabel_Axis_Trim    = 'trim';
  285.     kISpElementLabel_Axis_Rudder = 'rudd';                        {  delta  }
  286.     kISpElementLabel_Delta_X    = 'xdlt';
  287.     kISpElementLabel_Delta_Y    = 'ydlt';
  288.     kISpElementLabel_Delta_Z    = 'zdlt';
  289.     kISpElementLabel_Delta_Rx    = 'rxdl';
  290.     kISpElementLabel_Delta_Ry    = 'rydl';
  291.     kISpElementLabel_Delta_Rz    = 'rzdl';
  292.     kISpElementLabel_Delta_Roll    = 'rzdl';
  293.     kISpElementLabel_Delta_Pitch = 'rxdl';
  294.     kISpElementLabel_Delta_Yaw    = 'rydl';                        {  direction pad  }
  295.     kISpElementLabel_Pad_POV    = 'povh';                        {  up/down/left/right }
  296.     kISpElementLabel_Pad_Move    = 'move';                        {  up/down/left/right }
  297.     kISpElementLabel_Pad_POV_Horiz = 'hpov';                    {  forward/back/left/right }
  298.     kISpElementLabel_Pad_Move_Horiz = 'hmov';                    {  forward/back/left/right }
  299.                                                                 {  buttons  }
  300.     kISpElementLabel_Btn_Fire    = 'fire';
  301.     kISpElementLabel_Btn_SecondaryFire = 'sfir';
  302.     kISpElementLabel_Btn_Jump    = 'jump';
  303.     kISpElementLabel_Btn_PauseResume = 'strt';                    {  kISpElementLabel_Btn_PauseResume automatically binds to escape  }
  304.     kISpElementLabel_Btn_Select    = 'optn';
  305.     kISpElementLabel_Btn_SlideLeft = 'blft';
  306.     kISpElementLabel_Btn_SlideRight = 'brgt';
  307.     kISpElementLabel_Btn_MoveForward = 'btmf';
  308.     kISpElementLabel_Btn_MoveBackward = 'btmb';
  309.     kISpElementLabel_Btn_TurnLeft = 'bttl';
  310.     kISpElementLabel_Btn_TurnRight = 'bttr';
  311.     kISpElementLabel_Btn_LookLeft = 'btll';
  312.     kISpElementLabel_Btn_LookRight = 'btlr';
  313.     kISpElementLabel_Btn_LookUp    = 'btlu';
  314.     kISpElementLabel_Btn_LookDown = 'btld';
  315.     kISpElementLabel_Btn_Next    = 'btnx';
  316.     kISpElementLabel_Btn_Previous = 'btpv';
  317.     kISpElementLabel_Btn_SideStep = 'side';
  318.     kISpElementLabel_Btn_Run    = 'quik';
  319.     kISpElementLabel_Btn_Look    = 'blok';
  320.  
  321. {
  322.  *
  323.  * direction pad data & configuration information
  324.  *
  325.  }
  326.  
  327. TYPE
  328.     ISpDPadData                            = UInt32;
  329.  
  330. CONST
  331.     kISpPadIdle                    = 0;
  332.     kISpPadLeft                    = 1;
  333.     kISpPadUpLeft                = 2;
  334.     kISpPadUp                    = 3;
  335.     kISpPadUpRight                = 4;
  336.     kISpPadRight                = 5;
  337.     kISpPadDownRight            = 6;
  338.     kISpPadDown                    = 7;
  339.     kISpPadDownLeft                = 8;
  340.  
  341.  
  342. TYPE
  343.     ISpDPadConfigurationInfoPtr = ^ISpDPadConfigurationInfo;
  344.     ISpDPadConfigurationInfo = RECORD
  345.         id:                        UInt32;                                    {  ordering 1..n, 0 = no relavent ordering of direction pads  }
  346.         fourWayPad:                BOOLEAN;                                {  true if this pad can only produce idle + four directions  }
  347.     END;
  348.  
  349. {
  350.  *
  351.  * button data & configuration information
  352.  *
  353.  }
  354.     ISpButtonData                        = UInt32;
  355.  
  356. CONST
  357.     kISpButtonUp                = 0;
  358.     kISpButtonDown                = 1;
  359.  
  360.  
  361. TYPE
  362.     ISpButtonConfigurationInfoPtr = ^ISpButtonConfigurationInfo;
  363.     ISpButtonConfigurationInfo = RECORD
  364.         id:                        UInt32;                                    {  ordering 1..n, 0 = no relavent ordering of buttons  }
  365.     END;
  366.  
  367. {
  368.  *
  369.  * axis data & configuration information 
  370.  *
  371.  }
  372.     ISpAxisData                            = UInt32;
  373.     ISpAxisConfigurationInfoPtr = ^ISpAxisConfigurationInfo;
  374.     ISpAxisConfigurationInfo = RECORD
  375.         symetricAxis:            BOOLEAN;                                {  axis is symetric, i.e. a joystick is symetric and a gas pedal is not  }
  376.     END;
  377.  
  378.     ISpDeltaData                        = Fixed;
  379.     ISpDeltaConfigurationInfoPtr = ^ISpDeltaConfigurationInfo;
  380.     ISpDeltaConfigurationInfo = RECORD
  381.         reserved1:                UInt32;
  382.         reserved2:                UInt32;
  383.     END;
  384.  
  385.     ISpMovementDataPtr = ^ISpMovementData;
  386.     ISpMovementData = RECORD
  387.         xAxis:                    ISpAxisData;
  388.         yAxis:                    ISpAxisData;
  389.         direction:                ISpDPadData;                            {  ISpDPadData version of the movement  }
  390.     END;
  391.  
  392.     ISpMovementConfigurationInfoPtr = ^ISpMovementConfigurationInfo;
  393.     ISpMovementConfigurationInfo = RECORD
  394.         reserved1:                UInt32;
  395.         reserved2:                UInt32;
  396.     END;
  397.  
  398.  
  399. CONST
  400.     kISpVirtualElementFlag_UseTempMem = 1;
  401.  
  402.     kISpElementListFlag_UseTempMem = 1;
  403.  
  404.     kISpFirstIconSuite            = 30000;
  405.     kISpLastIconSuite            = 30100;
  406.     kISpNoneIconSuite            = 30000;
  407.  
  408.  
  409. {$IFC TARGET_RT_MAC_CFM }
  410. { ********************* user level functions ********************* }
  411. {
  412.  *
  413.  * startup / shutdown
  414.  *
  415.  }
  416. FUNCTION ISpStartup: OSStatus; C;
  417. {  1.1 or later }
  418. FUNCTION ISpShutdown: OSStatus; C;
  419. {  1.1 or later }
  420. {
  421.  *
  422.  * polling
  423.  *
  424.  }
  425. FUNCTION ISpTickle: OSStatus; C;
  426. {  1.1 or later }
  427. {********* user interface functions *********}
  428.  
  429. FUNCTION ISpGetVersion: NumVersion; C;
  430. {
  431.  *
  432.  * ISpElement_NewVirtual(ISpElementReference *outElement);
  433.  *
  434.  }
  435. FUNCTION ISpElement_NewVirtual(dataSize: UInt32; VAR outElement: ISpElementReference; flags: UInt32): OSStatus; C;
  436. {
  437.  *
  438.  * ISpElement_NewVirtualFromNeeds(UInt32 count, ISpNeeds *needs, ISpElementReference *outElements);
  439.  *
  440.  }
  441. FUNCTION ISpElement_NewVirtualFromNeeds(count: UInt32; VAR needs: ISpNeed; VAR outElements: ISpElementReference; flags: UInt32): OSStatus; C;
  442. {
  443.  *
  444.  * ISpElement_DisposeVirtual(inElement);
  445.  *
  446.  }
  447. FUNCTION ISpElement_DisposeVirtual(count: UInt32; VAR inElements: ISpElementReference): OSStatus; C;
  448. {
  449.  * ISpInit
  450.  *
  451.  }
  452. FUNCTION ISpInit(count: UInt32; VAR needs: ISpNeed; VAR inReferences: ISpElementReference; appCreatorCode: OSType; subCreatorCode: OSType; flags: UInt32; setListResourceId: INTEGER; reserved: UInt32): OSStatus; C;
  453.  
  454. {
  455.  * ISpConfigure
  456.  *
  457.  }
  458.  
  459. TYPE
  460. {$IFC TYPED_FUNCTION_POINTERS}
  461.     ISpEventProcPtr = FUNCTION(VAR inEvent: EventRecord): BOOLEAN; C;
  462. {$ELSEC}
  463.     ISpEventProcPtr = ProcPtr;
  464. {$ENDC}
  465.  
  466. FUNCTION ISpConfigure(inEventProcPtr: ISpEventProcPtr): OSStatus; C;
  467. {
  468.  *
  469.  * ISpStop
  470.  *
  471.  }
  472. FUNCTION ISpStop: OSStatus; C;
  473. {
  474.  *
  475.  * ISpSuspend, ISpResume
  476.  *
  477.  * ISpSuspend turns all devices off and allocates memory so that the state may be later resumed.
  478.  * ISpResume resumes to the previous state of the system after a suspend call.
  479.  * 
  480.  * Return Codes
  481.  * memFullErr
  482.  *
  483.  }
  484. FUNCTION ISpSuspend: OSStatus; C;
  485. FUNCTION ISpResume: OSStatus; C;
  486. {
  487.  * ISpDevices_Extract, ISpDevices_ExtractByClass, ISpDevices_ExtractByIdentifier
  488.  *
  489.  * These will extract as many device references from the system wide list as will fit in your buffer.  
  490.  *
  491.  * inBufferCount - the size of your buffer (in units of sizeof(ISpDeviceReference)) this may be zero
  492.  * buffer - a pointer to your buffer
  493.  * outCount - contains the number of devices in the system
  494.  *
  495.  * ISpDevices_ExtractByClass extracts and counts devices of the specified ISpDeviceClass
  496.  * ISpDevices_ExtractByIdentifier extracts and counts devices of the specified ISpDeviceIdentifier
  497.  *
  498.  * Return Codes
  499.  * paramErr
  500.  *
  501.  }
  502. FUNCTION ISpDevices_Extract(inBufferCount: UInt32; VAR outCount: UInt32; VAR buffer: ISpDeviceReference): OSStatus; C;
  503. FUNCTION ISpDevices_ExtractByClass(inClass: ISpDeviceClass; inBufferCount: UInt32; VAR outCount: UInt32; VAR buffer: ISpDeviceReference): OSStatus; C;
  504. FUNCTION ISpDevices_ExtractByIdentifier(inIdentifier: ISpDeviceIdentifier; inBufferCount: UInt32; VAR outCount: UInt32; VAR buffer: ISpDeviceReference): OSStatus; C;
  505.  
  506. {
  507.  * ISpDevices_ActivateClass, ISpDevices_DeactivateClass, ISpDevices_Activate, ISpDevices_Deactivate, ISpDevice_IsActive
  508.  *
  509.  * ISpDevices_Activate, ISpDevices_Deactivate
  510.  *
  511.  * This will activate/deactivate a block of devices.
  512.  * inDeviceCount - the number of devices to activate / deactivate
  513.  * inDevicesToActivate/inDevicesToDeactivate - a pointer to a block of memory contains the devices references
  514.  *
  515.  * ISpDevices_ActivateClass, ISpDevices_DeactivateClass
  516.  * inClass - the class of devices to activate or deactivate
  517.  *
  518.  * ISpDevice_IsActive
  519.  * inDevice - the device reference that you wish to 
  520.  * outIsActive - a boolean value that is true when the device is active
  521.  *
  522.  * Return Codes
  523.  * paramErr
  524.  *
  525.  }
  526. FUNCTION ISpDevices_ActivateClass(inClass: ISpDeviceClass): OSStatus; C;
  527. {  1.1 or later }
  528. FUNCTION ISpDevices_DeactivateClass(inClass: ISpDeviceClass): OSStatus; C;
  529. {  1.1 or later }
  530. FUNCTION ISpDevices_Activate(inDeviceCount: UInt32; VAR inDevicesToActivate: ISpDeviceReference): OSStatus; C;
  531. FUNCTION ISpDevices_Deactivate(inDeviceCount: UInt32; VAR inDevicesToDeactivate: ISpDeviceReference): OSStatus; C;
  532. FUNCTION ISpDevice_IsActive(inDevice: ISpDeviceReference; VAR outIsActive: BOOLEAN): OSStatus; C;
  533. {
  534.  * ISpDevice_GetDefinition
  535.  *
  536.  *
  537.  * inDevice - the device you want to get the definition for
  538.  * inBuflen - the size of the structure (sizeof(ISpDeviceDefinition))
  539.  * outStruct - a pointer to where you want the structure copied
  540.  *
  541.  * Return Codes
  542.  * paramErr
  543.  *
  544.  }
  545. FUNCTION ISpDevice_GetDefinition(inDevice: ISpDeviceReference; inBuflen: UInt32; VAR outStruct: ISpDeviceDefinition): OSStatus; C;
  546.  
  547. {
  548.  *
  549.  * ISpDevice_GetElementList
  550.  *
  551.  * inDevice - the device whose element list you wish to get
  552.  * outElementList - a pointer to where you want a reference to that list stored
  553.  *
  554.  * Return Codes
  555.  * paramErr
  556.  *
  557.  }
  558. FUNCTION ISpDevice_GetElementList(inDevice: ISpDeviceReference; VAR outElementList: ISpElementListReference): OSStatus; C;
  559. {
  560.  *
  561.  * takes an ISpElementReference and returns the group that it is in or 0 if there is
  562.  * no group
  563.  *
  564.  * Return Codes
  565.  * paramErr
  566.  *
  567.  }
  568. FUNCTION ISpElement_GetGroup(inElement: ISpElementReference; VAR outGroup: UInt32): OSStatus; C;
  569. {
  570.  *
  571.  * takes an ISpElementReference and returns the device that the element belongs 
  572.  * to.
  573.  *
  574.  * Return Codes
  575.  * paramErr if inElement is 0 or outDevice is nil
  576.  *
  577.  }
  578. FUNCTION ISpElement_GetDevice(inElement: ISpElementReference; VAR outDevice: ISpDeviceReference): OSStatus; C;
  579. {
  580.  *
  581.  * takes an ISpElementReference and gives the ISpElementInfo for that Element.  This is the
  582.  * the set of standard information.  You get ISpElementKind specific information
  583.  * through ISpElement_GetConfigurationInfo.
  584.  *
  585.  * Return Codes
  586.  * paramErr if inElement is 0 or outInfo is nil
  587.  *
  588.  }
  589. FUNCTION ISpElement_GetInfo(inElement: ISpElementReference; outInfo: ISpElementInfoPtr): OSStatus; C;
  590. {
  591.  *
  592.  *         
  593.  *
  594.  * takes an ISpElementReference and gives the ISpElementKind specific configuration information
  595.  * 
  596.  * if buflen is not long enough to hold the information ISpElement_GetConfigurationInfo will
  597.  * copy buflen bytes of the data into the block of memory pointed to by configInfo and
  598.  * will return something error.
  599.  *
  600.  * Return Codes
  601.  * paramErr if inElement or configInfo is nil
  602.  *
  603.  }
  604. FUNCTION ISpElement_GetConfigurationInfo(inElement: ISpElementReference; buflen: UInt32; configInfo: UNIV Ptr): OSStatus; C;
  605. {
  606.  *
  607.  * ISpElement_GetSimpleState
  608.  *
  609.  * Takes an ISpElementReference and returns the current state of that element.  This is a 
  610.  * specialized version of ISpElement_GetComplexState that is only appropriate for elements
  611.  * whose data fits in a signed 32 bit integer.
  612.  *
  613.  *
  614.  *
  615.  * Return Codes
  616.  * paramErr if inElement is 0 or state is nil
  617.  *
  618.  }
  619. FUNCTION ISpElement_GetSimpleState(inElement: ISpElementReference; VAR state: UInt32): OSStatus; C;
  620. {
  621.  *
  622.  * ISpElement_GetComplexState
  623.  *
  624.  * Takes an ISpElementReference and returns the current state of that element.  
  625.  * Will copy up to buflen bytes of the current state of the device into
  626.  * state.
  627.  *
  628.  *
  629.  * Return Codes
  630.  * paramErr if inElement is 0 or state is nil
  631.  *
  632.  }
  633. FUNCTION ISpElement_GetComplexState(inElement: ISpElementReference; buflen: UInt32; state: UNIV Ptr): OSStatus; C;
  634.  
  635. {
  636.  * ISpElement_GetNextEvent
  637.  *
  638.  * It takes in an element  reference and the buffer size of the ISpElementEventPtr
  639.  * it will set wasEvent to true if there was an event and false otherwise.  If there
  640.  * was not enough space to fill in the whole event structure that event will be
  641.  * dequed, as much of the event as will fit in the buffer will by copied and
  642.  * ISpElement_GetNextEvent will return an error.
  643.  *
  644.  * Return Codes
  645.  * paramErr
  646.  *
  647.  }
  648. FUNCTION ISpElement_GetNextEvent(inElement: ISpElementReference; bufSize: UInt32; event: ISpElementEventPtr; VAR wasEvent: BOOLEAN): OSStatus; C;
  649. {
  650.  *
  651.  * ISpElement_Flush
  652.  *
  653.  * It takes an ISpElementReference and flushes all the events on that element.  All it guaruntees is
  654.  * that any events that made it to this layer before the time of the flush call will be flushed and
  655.  * it will not flush any events that make it to this layer after the time when the call has returned.
  656.  * What happens to events that occur during the flush is undefined.
  657.  *
  658.  *
  659.  * Return Codes
  660.  * paramErr
  661.  *
  662.  }
  663. FUNCTION ISpElement_Flush(inElement: ISpElementReference): OSStatus; C;
  664.  
  665.  
  666. {
  667.  * ISpElementList_New
  668.  *
  669.  * Creates a new element list and returns it in outElementList.  In count specifies 
  670.  * the number of element references in the list pointed to by inElements.  If inCount
  671.  * is non zero the list is created with inCount elements in at as specified by the 
  672.  * inElements parameter.  Otherwise the list is created empty.
  673.  *
  674.  *
  675.  * Return Codes
  676.  * out of memory - If it failed to allocate the list because it was out of memory
  677.                    it will also set outElementList to 0
  678.  * paramErr if outElementList was nil
  679.  *
  680.  *
  681.  * Special Concerns
  682.  *
  683.  * interrupt unsafe
  684.  *
  685.  }
  686. FUNCTION ISpElementList_New(inCount: UInt32; VAR inElements: ISpElementReference; VAR outElementList: ISpElementListReference; flags: UInt32): OSStatus; C;
  687. {
  688.  * ISpElementList_Dispose
  689.  *
  690.  * Deletes an already existing memory list.  
  691.  *
  692.  *
  693.  * Return Codes
  694.  * paramErr if inElementList was 0
  695.  *
  696.  *
  697.  * Special Concerns
  698.  *
  699.  * interrupt unsafe
  700.  *
  701.  }
  702. FUNCTION ISpElementList_Dispose(inElementList: ISpElementListReference): OSStatus; C;
  703. {
  704.  * ISpGetGlobalElementList
  705.  *
  706.  * returns the global element list
  707.  *
  708.  * Return Codes
  709.  * paramErr if outElementList is nil
  710.  *
  711.  }
  712. FUNCTION ISpGetGlobalElementList(VAR outElementList: ISpElementListReference): OSStatus; C;
  713. {
  714.  * ISpElementList_AddElement
  715.  *
  716.  * adds an element to the element list
  717.  *
  718.  * Return Codes
  719.  * paramErr if inElementList is 0 or newElement is 0
  720.  * memory error if the system is unable to allocate enough memory
  721.  *
  722.  * Special Concerns
  723.  * interrupt Unsafe
  724.  * 
  725.  }
  726. FUNCTION ISpElementList_AddElements(inElementList: ISpElementListReference; refCon: UInt32; count: UInt32; VAR newElements: ISpElementReference): OSStatus; C;
  727. {
  728.  * ISpElementList_RemoveElement
  729.  *
  730.  * removes the specified element from the element list
  731.  *
  732.  * Return Codes
  733.  * paramErr if inElementList is 0 or oldElement is 0
  734.  * memory error if the system is unable to allocate enough memory
  735.  *
  736.  * Special Concerns
  737.  * interrupt Unsafe
  738.  * 
  739.  }
  740. FUNCTION ISpElementList_RemoveElements(inElementList: ISpElementListReference; count: UInt32; VAR oldElement: ISpElementReference): OSStatus; C;
  741. {
  742.  * ISpElementList_Extract
  743.  *
  744.  * ISpElementList_Extract will extract as many of the elements from an element list as possible.  You pass
  745.  * in an element list, a pointer to an array of element references and the number of elements in that array.
  746.  * It will return how many items are in the element list in the outCount parameter and copy the minimum of 
  747.  * that number and the size of the array into the buffer.
  748.  *
  749.  * ByKind and ByLabel are the same except that they will only count and copy element references to elements
  750.  * that have the specified kind and label.
  751.  *
  752.  * Return Codes
  753.  * paramErr
  754.  *
  755.  }
  756. FUNCTION ISpElementList_Extract(inElementList: ISpElementListReference; inBufferCount: UInt32; VAR outCount: UInt32; VAR buffer: ISpElementReference): OSStatus; C;
  757. FUNCTION ISpElementList_ExtractByKind(inElementList: ISpElementListReference; inKind: ISpElementKind; inBufferCount: UInt32; VAR outCount: UInt32; VAR buffer: ISpElementReference): OSStatus; C;
  758. FUNCTION ISpElementList_ExtractByLabel(inElementList: ISpElementListReference; inLabel: ISpElementLabel; inBufferCount: UInt32; VAR outCount: UInt32; VAR buffer: ISpElementReference): OSStatus; C;
  759. {
  760.  * ISpElementList_GetNextEvent
  761.  *
  762.  * It takes in an element list reference and the buffer size of the ISpElementEventPtr
  763.  * it will set wasEvent to true if there was an event and false otherwise.  If there
  764.  * was not enough space to fill in the whole event structure that event will be
  765.  * dequed, as much of the event as will fit in the buffer will by copied and
  766.  * ISpElementList_GetNextEvent will return an error.
  767.  *
  768.  * Return Codes
  769.  * paramErr
  770.  *
  771.  }
  772. FUNCTION ISpElementList_GetNextEvent(inElementList: ISpElementListReference; bufSize: UInt32; event: ISpElementEventPtr; VAR wasEvent: BOOLEAN): OSStatus; C;
  773. {
  774.  *
  775.  * ISpElementList_Flush
  776.  *
  777.  * It takes an ISpElementListReference and flushes all the events on that list.  All it guaruntees is
  778.  * that any events that made it to this layer before the time of the flush call will be flushed and
  779.  * it will not flush any events that make it to this layer after the time when the call has returned.
  780.  * What happens to events that occur during the flush is undefined.
  781.  *
  782.  *
  783.  * Return Codes
  784.  * paramErr
  785.  *
  786.  }
  787. FUNCTION ISpElementList_Flush(inElementList: ISpElementListReference): OSStatus; C;
  788. {
  789.  *
  790.  * ISpTimeToMicroseconds
  791.  *
  792.  *
  793.  * This function takes time from an input sprocket event and converts it
  794.  * into microseconds. (Version 1.2 or later of InputSprocket.)
  795.  *
  796.  *
  797.  * Return Codes
  798.  * paramErr
  799.  *
  800.  }
  801. FUNCTION ISpTimeToMicroseconds({CONST}VAR inTime: AbsoluteTime; VAR outMicroseconds: UnsignedWide): OSStatus; C;
  802. {$ENDC}  {TARGET_RT_MAC_CFM}
  803.  
  804.  
  805.  
  806.  
  807.  
  808. {$ALIGN RESET}
  809. {$POP}
  810.  
  811. {$SETC UsingIncludes := InputSprocketIncludes}
  812.  
  813. {$ENDC} {__INPUTSPROCKET__}
  814.  
  815. {$IFC NOT UsingIncludes}
  816.  END.
  817. {$ENDC}
  818.